using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace HX.Model.Xcode.BPM
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindIndex("YZPK_YZAppAttachment", true, "FileID")]
    [BindTable("YZAppAttachment", Description = "", ConnName = "BPMDB", DbType = DatabaseType.SqlServer)]
    public partial class YZAppAttachment : IYZAppAttachment
    {
        #region 属性
        private String _FileID;
        /// <summary></summary>
        [DisplayName("FileID")]
        [DataObjectField(true, false, false, 50)]
        [BindColumn("FileID", "", "nvarchar(50)")]
        public String FileID { get => _FileID; set { if (OnPropertyChanging(__.FileID, value)) { _FileID = value; OnPropertyChanged(__.FileID); } } }

        private String _Name;
        /// <summary></summary>
        [DisplayName("Name")]
        [DataObjectField(false, false, true, 256)]
        [BindColumn("Name", "", "nvarchar(256)", Master = true)]
        public String Name { get => _Name; set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } } }

        private String _Ext;
        /// <summary></summary>
        [DisplayName("Ext")]
        [DataObjectField(false, false, true, 8)]
        [BindColumn("Ext", "", "nvarchar(8)")]
        public String Ext { get => _Ext; set { if (OnPropertyChanging(__.Ext, value)) { _Ext = value; OnPropertyChanged(__.Ext); } } }

        private Int32 _Size;
        /// <summary></summary>
        [DisplayName("Size")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("Size", "", "int")]
        public Int32 Size { get => _Size; set { if (OnPropertyChanging(__.Size, value)) { _Size = value; OnPropertyChanged(__.Size); } } }

        private DateTime _LastUpdate;
        /// <summary></summary>
        [DisplayName("LastUpdate")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("LastUpdate", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime LastUpdate { get => _LastUpdate; set { if (OnPropertyChanging(__.LastUpdate, value)) { _LastUpdate = value; OnPropertyChanged(__.LastUpdate); } } }

        private String _OwnerAccount;
        /// <summary></summary>
        [DisplayName("OwnerAccount")]
        [DataObjectField(false, false, true, 30)]
        [BindColumn("OwnerAccount", "", "nvarchar(30)")]
        public String OwnerAccount { get => _OwnerAccount; set { if (OnPropertyChanging(__.OwnerAccount, value)) { _OwnerAccount = value; OnPropertyChanged(__.OwnerAccount); } } }

        private Int32 _LParam1;
        /// <summary></summary>
        [DisplayName("LParam1")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("LParam1", "", "int")]
        public Int32 LParam1 { get => _LParam1; set { if (OnPropertyChanging(__.LParam1, value)) { _LParam1 = value; OnPropertyChanged(__.LParam1); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.FileID: return _FileID;
                    case __.Name: return _Name;
                    case __.Ext: return _Ext;
                    case __.Size: return _Size;
                    case __.LastUpdate: return _LastUpdate;
                    case __.OwnerAccount: return _OwnerAccount;
                    case __.LParam1: return _LParam1;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.FileID: _FileID = Convert.ToString(value); break;
                    case __.Name: _Name = Convert.ToString(value); break;
                    case __.Ext: _Ext = Convert.ToString(value); break;
                    case __.Size: _Size = value.ToInt(); break;
                    case __.LastUpdate: _LastUpdate = value.ToDateTime(); break;
                    case __.OwnerAccount: _OwnerAccount = Convert.ToString(value); break;
                    case __.LParam1: _LParam1 = value.ToInt(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得YZAppAttachment字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field FileID = FindByName(__.FileID);

            /// <summary></summary>
            public static readonly Field Name = FindByName(__.Name);

            /// <summary></summary>
            public static readonly Field Ext = FindByName(__.Ext);

            /// <summary></summary>
            public static readonly Field Size = FindByName(__.Size);

            /// <summary></summary>
            public static readonly Field LastUpdate = FindByName(__.LastUpdate);

            /// <summary></summary>
            public static readonly Field OwnerAccount = FindByName(__.OwnerAccount);

            /// <summary></summary>
            public static readonly Field LParam1 = FindByName(__.LParam1);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得YZAppAttachment字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String FileID = "FileID";

            /// <summary></summary>
            public const String Name = "Name";

            /// <summary></summary>
            public const String Ext = "Ext";

            /// <summary></summary>
            public const String Size = "Size";

            /// <summary></summary>
            public const String LastUpdate = "LastUpdate";

            /// <summary></summary>
            public const String OwnerAccount = "OwnerAccount";

            /// <summary></summary>
            public const String LParam1 = "LParam1";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface IYZAppAttachment
    {
        #region 属性
        /// <summary></summary>
        String FileID { get; set; }

        /// <summary></summary>
        String Name { get; set; }

        /// <summary></summary>
        String Ext { get; set; }

        /// <summary></summary>
        Int32 Size { get; set; }

        /// <summary></summary>
        DateTime LastUpdate { get; set; }

        /// <summary></summary>
        String OwnerAccount { get; set; }

        /// <summary></summary>
        Int32 LParam1 { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}